<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">

</head>
<body>
<p>

<div style="display: flex; align-items: center; justify-content: space-between;">
    <form action="/student/listName" method="post">
        <div class="layui-form-item">
            <div class="layui-inline">
                <div class="layui-input-inline layui-input-wrap">
                    <input type="text" placeholder="请输入姓名" name="studentName" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
                </div>
                <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">按姓名查询</button>
                <a class="layui-btn layui-bg-blue" href="/student/toadd">增加学生</a>
            </div>
        </div>
    </form>

    <form action="/student/listStatus" method="post">
        <div class="layui-form-item">
            <div class="layui-inline">
                <div class="layui-input-inline layui-input-wrap">
                    <input type="text" placeholder="请输入状态" name="status" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
                </div>
                <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">按状态查询</button>
            </div>
        </div>
    </form>

    <form action="/student/listNum" method="post">
        <div class="layui-form-item">
            <div class="layui-inline">
                <div class="layui-input-inline layui-input-wrap">
                    <input type="text" placeholder="请输入学号" name="studentNum" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
                </div>
                <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">按学号查询</button>
            </div>
        </div>
    </form>

</div>


<div style="display: flex; justify-content: space-between;">
    <form action="/student/listMajor" method="post">
        <div class="layui-form-item">
            <div class="layui-inline">
                <div class="layui-input-inline layui-input-wrap">
                    <input type="text" placeholder="请输入专业" name="major" lay-verify="required" autocomplete="off"
                           lay-affix="clear" class="layui-input">
                </div>
                <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">按专业查询</button>
            </div>
        </div>
    </form>
</div>



</p>
<table class="layui-table" lay-even>
    <colgroup>
        <col width="250">
        <col width="250">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>编号</th>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>生日</th>
        <th>班级</th>
        <th>宿舍号</th>
        <th>电话</th>
        <th>邮箱</th>
        <th>家庭住址</th>
        <th>紧急联系人姓名</th>
        <th>紧急联系人电话</th>
        <th>专业</th>
        <th>学生状态</th>

        <%--        <th>创建者</th>--%>
        <%--        <th>创建时间</th>--%>
        <%--        <th>更新者</th>--%>
        <%--        <th>更新时间</th>--%>
        <th>备注</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${students}" var="s">
        <tr>
            <td>${s.sid}</td>
            <td>${s.studentNum}</td>
            <td>${s.studentName}</td>
            <td>${s.gender}</td>
            <td>${s.age}</td>
            <td><fmt:formatDate value="${s.birthday}"></fmt:formatDate></td>
            <td>${s.cid}</td>
            <td>${s.hid}</td>
            <td>${s.phone}</td>
            <td>${s.email}</td>
            <td>${s.address}</td>
            <td>${s.emergencyContact}</td>
            <td>${s.emergencyContactPhone}</td>
            <td>${s.major}</td>
            <td>${s.status}</td>

                <%--            <td>${s.createBy}</td>--%>
                <%--            <td><fmt:formatDate value="${s.createTime}"></fmt:formatDate></td>--%>
                <%--            <td>${s.updateBy}</td>--%>
                <%--            <td><fmt:formatDate value="${s.updateTime}"></fmt:formatDate></td>--%>
            <td>${s.remark}</td>


            <td>
                <a href="/student/toupdate/${s.sid}">修改</a>
                <a href="/student/delete/${s.sid}">删除</a>
            </td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="4">
            <a href="/student/list/1">首页</a>
            <c:if test="${page.currentPage!=1}">
                <a href="/student/list/${page.currentPage-1}">上一页</a>
            </c:if>
            第${page.currentPage}页/总${page.totalPage}页
            <c:if test="${page.currentPage!=page.totalPage}">
                <a href="/student/list/${page.currentPage+1}">下一页</a>
            </c:if>
            <a href="/student/list/${page.totalPage}">末页</a>
        </td>
    </tr>
    </tbody>
</table>
</body>
</html>
